#include "app_runner.h"
#include "app_bt.h"
#include "app_deviece.h"
#include "log/log.h"
#include "unistd.h"
#include "signal.h"
static int is_running = 1;
static void exit_handler(int signum)
{
    is_running = 0;
}
int app_runner_run()
{
    signal(SIGINT, exit_handler);
    signal(SIGTERM, exit_handler);
    //初始化设备
    Device *device = app_device_init(SERIAL_PATH);
    //初始化蓝牙
    app_bt_init(device);
    //启动设备
    app_device_start();
    //当运行标识为1时，一直运行
    while (is_running == 1)
    {
        sleep(1);
    }
    //标识为0时，停止设备
    app_device_destroy();
    
}